# ---------- ---------- ---------- ---------- ---------- ----------
#
#   This makefile generates the il.ly app.
#
# ---------- ---------- ---------- ---------- ---------- ----------

Verbose=$(if $(v),--info --stacktrace --debug,)
UserAt=$(if $(u),$(u)@,)

Slug='\#' ---------- ---------- ---------- ---------- ---------- ----------

target: prerequisites 
prerequisites: help

# ---------- ---------- ---------- ---------- ---------- ----------
#   NOTE: The remaining recipes follow:
# ---------- ---------- ---------- ---------- ---------- ----------

.PHONY: help
help:
	@echo
	@echo See the makefile, README.md, or HELP.md for more info.
	@echo

.PHONY: deps-debian9
deps-debian9:
	@sudo apt-get install -y build-essential
	@sudo apt-get install lib32stdc++6 lib32z1
	@curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
	@sudo apt-get install -y nodejs
	@sudo npm i npm@latest -g

.PHONY: deps
deps:
	@echo See platform specific deps.

.PHONY: check
check:
	@echo Verifying dependiencies...
	npm --version
	@echo $(Slug)
	echo $$ANDROID_HOME
	@echo $(Slug)
	aapt v

.PHONY: start-reset
start-reset:
	@npm start --reset-cache

.PHONY: dev-android-build
dev-android-build:
	@cd android && ./gradlew assembleDebug $(Verbose)

.PHONY: android-build
android-build:
	@cd android && ./gradlew assembleRelease $(Verbose)

.PHONY: show
show:
	ls android/app/build/outputs/apk/ -asl

.PHONY: build
build:
	@echo See platform-release specific builds.

.PHONY: clean
clean:
	rm -rf android/app/build/outputs/apk/
